package com.uubx.dao.impl;

import com.uubx.dao.InsuranceDescDao;
import com.uubx.pojo.InsuranceDesc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

/**
 * @Author wyy
 * @Date 2020/12/30 23:59
 * @Version 1.0
 */
public class InsuranceDescDaoImpl implements InsuranceDescDao {
    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public void addInsuranceDesc(InsuranceDesc insuranceDesc) {
        mongoTemplate.save(insuranceDesc);
    }

    @Override
    public void updateInsuranceDesc(InsuranceDesc insuranceDesc) {
        mongoTemplate.save(insuranceDesc);
    }

    @Override
    public InsuranceDesc findInsuranceDescById(String id) {
        return mongoTemplate.findById(id,InsuranceDesc.class);
    }
}
